define(function(require, exports, module) {

  // var Backbone = require('backbone');
  var $ = require('jquery');
  // var _ = require('underscore');
  // var jsonview = require('jsonview');
  var tmpl = require('text!../tmpl.html');
  var THREE = require('three');

  function main() {
    var $app = $('<div id="app">');
    $('#main').html($app);

    $app.append(tmpl);

    window.THREE = THREE;

    //自己从 EffectComposer 拿出来的,本来有循环依赖
    require([
      'http://localhost/d/threejs-0.106.2/examples/js/postprocessing/Pass',
      'http://localhost/d/threejs-0.106.2/examples/js/lines/LineSegmentsGeometry',
      'http://localhost/d/threejs-0.106.2/examples/js/lines/LineSegments2'
    ], function() {
      require(['./main'], function(mainApp) {
        mainApp($app);
      })
    })
    
  }

  return main;
})